/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package is202.hrms.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

/**
 *
 * @author MrVegard
 */
@Entity
@IdClass(Progid.class)
public class Progress implements Serializable {
    @Id @ManyToOne private Usere bruker;
    @Id @ManyToOne private Modulen moduler;
    @OneToOne private Feedback feedback;
    @OneToOne private StoredFile storedfile;
    private boolean approved;

    public Progress() {
    }

    public StoredFile getStoredfile() {
        return storedfile;
    }

    public void setStoredfile(StoredFile storedfile) {
        this.storedfile = storedfile;
    }
    
    
    public boolean isApproved() {
        return approved;
    }

    public void setApproved(boolean approved) {
        this.approved = approved;
    }
    
    

    public Feedback getFeedback() {
        if(feedback != null){
        return feedback;    
        }else{
            return new Feedback();
        }
        
    }

    public void setFeedback(Feedback feedback) {
        this.feedback = feedback;
    }

    public Usere getBruker() {
        return bruker;
    }

    public void setBruker(Usere bruker) {
        this.bruker = bruker;
    }

    public Modulen getModuler() {
        return moduler;
    }

    public void setModuler(Modulen moduler) {
        this.moduler = moduler;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 19 * hash + (this.bruker != null ? this.bruker.hashCode() : 0);
        hash = 19 * hash + (this.moduler != null ? this.moduler.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Progress other = (Progress) obj;
        if (this.bruker != other.bruker && (this.bruker == null || !this.bruker.equals(other.bruker))) {
            return false;
        }
        if (this.moduler != other.moduler && (this.moduler == null || !this.moduler.equals(other.moduler))) {
            return false;
        }
        return true;
    }

    
    
}